package com.coding.kan_yi_dao.controller;


import com.coding.kan_yi_dao.common.Result;
import com.coding.kan_yi_dao.entity.ShoppingCartItem;
import com.coding.kan_yi_dao.service.impl.ShoppingCartItemServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 砍一刀，不买就砍你一刀
 * @since 2023-09-20
 */
@Api(tags = "购物车配置")
@RestController
@RequestMapping("/shopping-cart-item")
@CrossOrigin
public class ShoppingCartItemController {

    @Resource
    ShoppingCartItemServiceImpl shoppingCartItemService;

    //TODO 查询
    @ApiOperation(value = "全查询")
    @GetMapping("/go_sekect/shopping")
    public Result go_select(ShoppingCartItem shoppingCartItem) {
        return shoppingCartItemService.go_select(shoppingCartItem);
    }

    //TODO 修改
    @ApiOperation(value = "修改")
    @GetMapping("/go_update/shopping")
    public Result go_update(ShoppingCartItem shoppingCartItem) {
        return shoppingCartItemService.go_update(shoppingCartItem);
    }

    //TODO 添加
    @ApiOperation(value = "添加")
    @GetMapping("/go_insert/shopping")
    public Result go_insert(ShoppingCartItem shoppingCartItem) {
        return shoppingCartItemService.go_insert(shoppingCartItem);
    }

    //TODO 删除
    @ApiOperation(value = "删除")
    @GetMapping("/go_delete/shopping")
    public Result go_delete(@RequestParam(value="ids",required=false) List<Integer> ids) {
        return shoppingCartItemService.go_delete(ids);
    }
}
